package com.cicigodd.brick.plug.common.tree.node;

import com.cicigodd.brick.plug.common.tree.factory.base.AbstractTreeNode;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * 通用树节点
 *
 * @author cicigodd
 * @date 2020/12/27 18:36
 */
@Data
public class AntdesignTreeNode implements AbstractTreeNode {


    @ApiModelProperty("父id，一级节点父id是-1")
    private Long parentId;

    @ApiModelProperty("节点值")
    private Long id;

    @ApiModelProperty("节点名称")
    private String title;

    @ApiModelProperty("编码")
    private String code;

    @ApiModelProperty("是否展开状态 不展开-false 展开-true")
    private boolean spread = true;

    @ApiModelProperty("是否选中")
    private boolean selected = false;

    @ApiModelProperty("子节点的集合")
    private List<AntdesignTreeNode> children;

    @Override
    public String getNodeId() {
        return this.id.toString();
    }

    @Override
    public String getNodeParentId() {
        return this.parentId.toString();
    }

    @Override
    public void setChildrenNodes(List childrenNodes) {
        this.children = childrenNodes;
    }
}
